package com.bauer.os.frame.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import com.bauer.os.frame.dao.SysUserMapper;
import com.bauer.os.frame.domain.po.SysUser;
import com.bauer.os.frame.domain.po.SysUserExample;
import com.bauer.os.frame.service.SysUserService;

@Service
public class SysUserServiceImpl implements SysUserService{

	@Autowired
	private SysUserMapper  sysUserMapper;
	
	public SysUser findUserByName(String userName) {
		SysUserExample ex= new SysUserExample();
		ex.or().andNameEqualTo(userName);
		List<SysUser> list=sysUserMapper.selectByExample(ex);
		if(CollectionUtils.isEmpty(list)){
			return null;
		}
		return list.get(0);
	}

}
